/**
 * @param {number[]} nums
 * @param {number} val
 * @return {number}32 45
 */
console.log(removeElement([3, 2, 2, 3, 1, 3], 3));

function removeElement(nums, val) {
    if (nums.length == 0) { return 0 }
    var j = 0;
    for (i = 0; i < nums.length; i++) {
        if (nums[i] == val) {} else {
            nums[j] = nums[i];
            j++;
        }
    }
    return j;
};